<template>
	<view>
		<up-navbar :fixed="fixed" :title="title" :titleStyle="{'color':titlecolor,'fontWeight':fontWeight}"
			:autoBack="true" :placeholder="true" :bgColor="bgColor" :leftIconColor="leftIconColor"
			@rightClick="emit('rightClick')">
			<template #right v-if="righticon == 'more'">
				<view class="right-icon flex-center">
					<image src="/static/icon/arcoDesign-more 1@1x.png" mode=""></image>
				</view>
			</template>
			<template #right v-else>
				<view class="right-icon flex-center">
					<image :src="righticon" mode=""></image>
				</view>
			</template>
		</up-navbar>
	</view>
</template>

<script setup>
	import {
		defineProps,
		defineEmits
	} from 'vue';
	const emit = defineEmits(['rightClick'])
	const props = defineProps({
		title: { //标题
			type: String,
			default: ''
		},
		bgColor: { //背景颜色
			type: String,
			default: '#fff'
		},
		leftIconColor: { //左侧返回图标的颜色
			type: String,
			default: '#fff'
		},
		titlecolor: {
			type: String,
			default: '#fff'
		},
		fontWeight: {
			type: [Number,String],
			default: 500
		},
		righticon: {
			type: String,
			default: ''
		},
		fixed: {
			type: Boolean,
			default: false
		}
	})
</script>

<style scoped lang="scss">
	.right-icon {
		image {
			width: 48rpx;
			height: 48rpx;
		}
	}
</style>